package com.taxi.driver.module.recruit.selectcity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.taxi.driver.R;
import com.taxi.driver.common.BaseActivity;

/**
 * 选择城市
 * Created by Curry on 2018/5/14.
 */

public class SelectCityActivity extends BaseActivity
{
    private static final String KEY_ADDRESS_TYPE = "ADDRESS_TYPE";
    private static final String KEY_CAR_TYPE = "CAR_TYPE";
    SelectCityFragment mSelectCityFragment;
    public static void startIntent(Context context) {
        Intent intent = new Intent(context, SelectCityActivity.class);
//        intent.putExtra(KEY_ADDRESS_TYPE, type);
//        intent.putExtra(KEY_CAR_TYPE, carType);
        context.startActivity(intent);
    }
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.select_city);

        if (mSelectCityFragment == null) {
//            AddressType type = (AddressType) getIntent().getSerializableExtra(KEY_ADDRESS_TYPE);
//            CarType carType = (CarType) getIntent().getSerializableExtra(KEY_CAR_TYPE);
            mSelectCityFragment = SelectCityFragment.newInstance();
            addFragment(R.id.fragment_container, mSelectCityFragment);
        }
    }

    @Override
    public void onAttachFragment(Fragment fragment) {
        super.onAttachFragment(fragment);
        if (fragment instanceof SelectCityFragment) {
            mSelectCityFragment = (SelectCityFragment) fragment;
        }
    }

}
